import base64
import requests

c = 'Portal'
a = 'login'
login_method = '1'

# 账号和密码
user_account = ',0,xxxxxxxxxxx' # 输出账号
user_password = 'xxxxxxxx' # 输入密码

# 登录地址
post_addr = "http://100.64.13.17:801/eportal/?c=Portal&a=login"  # 提交地址
# 构造头部信息
post_header = {
     'Accept': '*/*',
     'Accept-Encoding': 'gzip, deflate',
     'Accept-Language': 'zh-CN,zh;q=0.9',
     'Connection': 'keep-alive',
     'Host': '100.64.13.17:801',
     'Referer': 'http://100.64.13.17/'
}

post_data = {
    'c' : c,
    'a' : a,
    'login_method' : login_method,
    'user_account' : user_account,
    'user_password' : user_password,
}

# 发送post请求登录网页
try :
    z = requests.post(post_addr, data=post_data, headers=post_header)
    print(z)
except:
    print("登录异常!")
print("登录成功,可以愉快的冲浪了!")